//
//  Test.m
//  帮惠Mall
//
//  Created by reew on 2017/10/16.
//  Copyright © 2017年 reew. All rights reserved.
//

#import "Test.h"

@implementation Test
+(void)sendPOST:(NSString *)URLString parameters:(id)parameters constructingBodyWithBlock:(void (^)(id<AFMultipartFormData>))block progress:(void (^)(NSProgress * _Nonnull))uploadProgress success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSURLSessionDataTask *, NSError *))failure{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/javascript", @"text/html",@"image/png",nil];
    manager.requestSerializer = [AFHTTPRequestSerializer serializer];
    
    manager.responseSerializer =[AFJSONResponseSerializer serializer];//以json格式返回
    manager.requestSerializer = [AFJSONRequestSerializer serializer];//以json格式提交
    manager.requestSerializer.timeoutInterval = 10.0f;
    [manager POST:URLString parameters:parameters constructingBodyWithBlock:block progress:uploadProgress success:success failure:failure];
    
}
@end
